import { HTTP } from '../utils/request';
const http = new HTTP();

// 获取用户提交的个体户申请列表
export function getSelfEmployedList({page}){
    return http.request({
        url: '/v1/applet/self/employed/user/page/list',
        method: 'get',
        data: {
            'pageIndex': page,
            'pageSize': 10,
        }
    })
}

// 获取关联了园区、切园区和企业状态正常开启中的劳务企业列表
export function laborHasIndustrialList(){
    return http.request({
        url: '/v1/applet/labor/company/has/industrial/park/list',
        method: 'get',
        data: {}
    })
}

// 获取劳务公司行业列表
export function laborIndustryList({laborCompanyId}){
    return http.request({
        url: '/v1/applet/labor/company/industry/list',
        method: 'get',
        data: {
            'laborCompanyId': laborCompanyId, // 劳务公司ID
        }
    })
}

// 根据劳务公司和行业获取行业详情
export function industrialParkPolicyDetail({laborCompanyId,industry}){
    return http.request({
        url: '/v1/applet/industrial/park/policy/detail',
        method: 'get',
        data: {
            'laborCompanyId': laborCompanyId, // 劳务公司ID
            'industry': industry, // 行业信息
        }
    })
}

// 提交个体户申请
export function saveSelfEmplooyed({laborCompanyId,industry,realName,idCard,mobile,email,bankCard,bankName,oneInchPhoto,idCardFront,idCardBack,id,residence,postCode,politicalStatus,nation,eduLevel,careerStatus,signPicUrl}){
    return http.request({
        url: '/v1/applet/self/employed/save',
        method: 'post',
        data: {
            'laborCompanyId': laborCompanyId, // 劳务公司ID
            'industry': industry, // 行业
            'realName': realName, // 姓名
            'idCard': idCard, // 身份证号码
            'mobile': mobile, // 手机号
            'email': email, // 电子邮箱
            'bankCard': bankCard, // 银行卡号
            'bankName': bankName, // 银行名称
            'oneInchPhoto': oneInchPhoto, // 一寸照
            'idCardFront': idCardFront, // 身份证正面照
            'idCardBack': idCardBack, // 身份证反面照
            'residence': residence, // 住所
            'postCode': postCode, // 邮编地址
            'politicalStatus': politicalStatus, // 政治面貌
            'nation': nation, // 民族
            'eduLevel': eduLevel, // 文化程度
            'careerStatus': careerStatus, // 职业状况
            'signPicUrl': signPicUrl, // 用户签名
            'id': id,
        }
    })
}

// 获取个体户申请记录详情
export function getSelfEmployedDetail({id}){
    return http.request({
        url: '/v1/applet/self/employed/detail',
        method: 'get',
        data: {
            'id': id,
        }
    })
}

// 获取个体户申请前是否和劳务公司签约
export function appletSelfEmployedStatus({LaborCompanyId}){
  return http.request({
    url: '/v1/applet/self/employed/status',
    method: 'get',
    data: {
      'LaborCompanyId': LaborCompanyId, // 劳务公司ID
    }
  })
}

// 获取政治面貌下拉列表
export function querySelfEmployedPolitical(){
  return http.request({
    url: '/v1/applet/self/employed/politicalStatus',
    method: 'get',
    data: {}
  })
}

// 获取文化程度下拉列表
export function querySelfEmployedEdulevel(){
  return http.request({
    url: '/v1/applet/self/employed/eduLevel',
    method: 'get',
    data: {}
  })
}

// 获取职业状况下拉列表
export function querySelfEmployedCareer(){
  return http.request({
    url: '/v1/applet/self/employed/careerStatus',
    method: 'get',
    data: {}
  })
}